# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=gtk-doc
pkgver=1.32
pkgrel=1
pkgdesc="Documentation tool for public library API"
arch=('i686' 'x86_64')
url="https://www.gtk.org/gtk-doc/"
license=("GPL" "FDL")
options=(staticlibs strip)
depends=("docbook-xsl"
         "glib2"
         "gnome-doc-utils"
         "libxml2-python"
         "python3"
         "vim"
         "yelp-tools"
         "python2-six"
        )
makedepends=("pkg-config"
             "glib2-devel"
             "python3"
             'itstool'
            )
source=(https://download.gnome.org/sources/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.xz)
sha256sums=('de0ef034fb17cb21ab0c635ec730d19746bce52984a6706e7bbec6fb5e0b907c')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  libtoolize --force --copy
  autoreconf -fi
}

build() {
  mkdir -p "${srcdir}/build-${CHOST}"
  cd "${srcdir}/build-${CHOST}"
  export PYTHON=/usr/bin/python3
  ../${pkgname}-${pkgver}/configure \
    --prefix=/usr \
    --build=${CHOST} \
    --host=${CHOST} \
    --enable-shared \
    --enable-static \
    --with-xml-catalog=/etc/xml/catalog
  make
}

package() {
  cd "${srcdir}/build-${CHOST}"
  make DESTDIR="${pkgdir}" install
}
